all the Source code really helpfull recomend to check OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == true)//if user chose a file { //do something }